

// @ts-ignore
import { ICourse } from './ICourseService.d.ts';



export  class TypeScriptCourse implements ICourse {
    // 类中必须包含接口中定义的所有属性
    id: number;
    name: string;
    price: Amount;

    // 类中必须包含接口中定义的所有方法
    constructor(id: number, name: string, price: Amount) {
        this.id = id;
        this.name = name;
        this.price = price;
    }

    getId(): number {
        return this.id;
    }

    getName(): string {
        return this.name;
    }

    getPrice(): Amount {
        return this.price;
    }
    getPriceInDollars(): number {

        return  parseFloat( this.price.toFixed(2));
    }
}


